package com.example.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * TODO
 *
 * @author ding
 * @since 2024/5/31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("project")
@ApiModel("项目信息")
public class Project {
    @ApiModelProperty("项目Id")
    @TableId(type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("项目名称")
    private String name;
    /* 项目预算 */
    @ApiModelProperty("项目预算")
    private BigDecimal budget;
    /** 阶段个数 */
    private Integer number;

    @ApiModelProperty("项目描述")
    private String description;
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("项目开始工期")
    private LocalDate begin;
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("项目结束工期")
    private LocalDate end;
    @ApiModelProperty("负责团队Id")
    private Integer teamId;
    /* 委托单位名称  */
    @ApiModelProperty("委托单位Id")
    private Integer entrustId;
    /* 项目实际开销 */
    @ApiModelProperty("项目实际开销")
    private Double price;
    /* 审核状态 */
    @ApiModelProperty("项目审核状态")
    private Integer status;
    /* 删除状态 */
    @ApiModelProperty("项目信息删除状态")
    private Integer isDeleted;
    /** 工程封面 */
    @ApiModelProperty("项目封面图片")
    private String img;

    /** 乐观锁版本号 */
    @ApiModelProperty("乐观锁版本号")
    @Version
    @TableField(value = "version", fill = FieldFill.INSERT)
    private Integer version;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    /** 更新时间 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private String entrustName;
    @TableField(exist = false)
    private String teamName;
    @TableField(exist = false)
    private String address;

}
